﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Helper
{
    public class ActivityMonitor
    {
        public static void Log(string message)
        {
            try
            { 
                // record log to local file
                string AppFolder = "OneTouchBanking_Log";
                if (!System.IO.Directory.Exists(@"C:\\" + AppFolder))
                {
                    System.IO.Directory.CreateDirectory(@"C:\\" + AppFolder);
                }

                string activity_fileName = @"C:\\" + AppFolder + "\\activity_" + DateTime.Today.ToString("yyyy-MM-dd") + ".txt";
                using (StreamWriter writetext = new StreamWriter(activity_fileName, true))
                {
                    writetext.WriteLine(DateTime.Now.ToShortTimeString());
                    writetext.WriteLine(message);
                }
            }
            catch (Exception ex)
            {
            }

        }
    }
}
